package com.lyy.common.utils;


import java.util.HashMap;
import java.util.Map;

public class Constants {

    /**
     * token 置过秘钥
     */
    public static final String SALT = "api_tools";
    /**
     * 短信验证码位数
     */
    public static final int CODE_BIT = 6;
    /**
     * 获取时间戳的差为60分钟
     */
    public static final long HOUR_DIFF = 60 * 60 * 1000;

    /**
     * 获取时间戳的差为3分钟
     */
    public static final long TIME_DIFF = 3 * 60 * 1000;

    /**
     * 加密次数
     */
    public static final int HASH_ITERATIONS = 3;

    /**
     * token 过期时间7天
     */
    public static final long EXPIRE_TIME = 7 * 24 * 60 * 60 * 1000;
    /**
     * token 过期时间30天
     */
    public static final long EXPIRE_LONG_TIME = 20 * 24 * 60 * 60 * 1000;

    /**
     * 登陆token
     */
    public static final String LOGIN_TOKEN = "accessToken";

    /**
     * 基础路径
     */
    public static String basePath;

    /**
     * 图片浏览地址
     */
    public static String address;

    public static void setAddress(String address) {
        Constants.address = address;
    }

    /**
     * 获取图片上传路径
     * 100      菜单图片
     *
     * @param type
     * @return
     */
    public static Map<String, String> getUploadUrl() {
        Map<String, String> map = new HashMap<>();
        map.put("100", "/apiTools/userPhoto/");
        return map;
    }
}